package com.learning.Map;

import java.util.Date;

public class Student implements Comparable<Student> {

    private int id;
    private Date brithday;
    private String name;


    public Student() {
    }

    public Student(int id, Date brithday, String name) {
        this.id = id;
        this.brithday = brithday;
        this.name = name;

    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public Date getBrithday() {
        return brithday;
    }

    public void setBrithday(Date brithday) {
        this.brithday = brithday;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }


    @Override
    public int compareTo(Student o) {
        //return -this.brithday.compareTo(o.brithday);

        //return this.name.compareTo(o.name);

        return this.id - o.id;
    }

    @Override
    public String toString() {
        return "Student{" +
                "id=" + id +
                ", brithday=" + brithday.toLocaleString() +
                ", name='" + name + '\'' +
                '}';
    }
}
